<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div>
    <a href="/">回到首页</a>
    <span> <%= username %></span>
    <a href="/write">写文章</a>
    <a href="/users/logout">退出</a>
  </div>

  <div>
    <form action="/article/add" method="POST">
      <% if(item){ %>
      <input type="hidden" name="id" value="<%- item[0].id %>">
      <input type="hidden" name="page" value="<%- item[0].page %>">
      <input type="text" name='title' placeholder="请输入文章标题" value="<%=item[0].title%> ">
      <textarea name="content" id="1" cols="30" rows="10"><%- item[0].content %></textarea>
      <input type="submit" value="发布">
      <% }else{ %>
        <input type="text" name='title' placeholder="请输入文章标题">
        <textarea name="content" id="1" cols="30" rows="10"></textarea>
        <input type="submit" value="修改">
      <% } %>
    </form>
  </div>
</body>
</html>